<template>
  <div class="ft">
    <div id="xi">
      <mt-header title="个人资料" class="inmoder" fixed id="po">
        <mt-button icon="back" slot="left" @click="$router.go(-1)"></mt-button>
      </mt-header>
    </div>
      <div class="ht"  v-for="(items) in datas" :key="items.uid">
        <mt-cell title="头像" is-link>
          <img :src="`${items.uavatar}`" alt="" class="yu" />
        </mt-cell>
        <template v-if="$store.state.ismember">
        <mt-cell title="昵称" is-link v-for="(item) in data" :key="item.mid">
          <span style="">{{item.mname}}</span>
        </mt-cell>
        </template>
        <template v-else>
        <mt-cell title="昵称" is-link >
          <span style="">{{items.uname}}</span>
        </mt-cell>
        </template>
        <mt-cell title="手机" :value="items.uphone"></mt-cell>
        <mt-cell title="UID" :value="items.uid"></mt-cell>
        <mt-cell title="完善信息" is-link>
          <span style="">待填写</span>
        </mt-cell>
      </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      data: [],
      datas:[]
    };
  },
  mounted() {
    if (this.$store.state.islogin) {
      this.getlogin();
    } 
   if (this.$store.state.ismember) {
      this.getloginvip();
    }
  },
  methods: {
    getlogin() {
      this.axios
        .post("/user/loginok", `uphone=${this.$store.state.uphone}`)
        .then((res) => {
            console.log(res);
          this.datas=res.data.data;
        });
    },
    getloginvip() {
      this.axios
        .post("/user/loginvip", `mphone=${this.$store.state.mphone}`)
        .then((res) => {
          this.data=res.data.data;
        });
    },
  },
};
</script>
<style scoped>
.ft {
  height: 170vw;
  width: 100vw;
  background-color: rgb(242, 242, 242);
}
#po {
  background-color: #fff;
  color: #000;
  font-size: 5vw;
  font-weight: bold;
}
#xi {
  margin-bottom: 13vw;
  display: flex;
}
.yu {
  width: 10vw;
  height: 10vw;
}
.ht {
  text-align: left;
}
</style>
